package com.hjy.controller;

import com.hjy.Utils.Result;
import com.hjy.entity.Patient;
import com.hjy.service.PatientService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
public class PatientController {
    @Autowired
    private PatientService patientService;
    @RequestMapping("getPatients")
    @ResponseBody
    public Object getPatients(Patient patient){
        List<Patient> list = patientService.getPatients(patient);
        int total = patientService.total(patient);
        return Result.toClient("0","",total,list);

    }
}
